package com.example.huadu_server.house.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.sql.Timestamp;

@Data
@TableName("favority")
public class Favorite {

    @TableId(type = IdType.AUTO)
    private Integer id; // 收藏ID

    // 用户ID，外键关联 user 表
    private Integer userId;

    // 房屋ID，外键关联 house 表
    private Integer houseId;

    @TableField("time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Timestamp time; // 创建时间和更新时间
}
